<template>
    <div class="warn__box">{{warnData}}</div>
</template>

<script>
import { reactive } from 'vue'
export const useToast = () => {
  const toastData = reactive({
    warnData: '',
    iswarn: false
  })
  const loginWarnFn = mess => {
    toastData.warnData = mess
    toastData.iswarn = true
    setTimeout(() => {
      toastData.iswarn = false
      toastData.warnData = ''
    }, 2000)
  }

  return { toastData, loginWarnFn }
}
export default {
  name: 'Warn',
  props: ['warnData']
}
</script>

<style lang="scss" scoped>
@import '../../style/mixinApi.scss';
.warn__box {
  @include MessCenterFn()
}
</style>
